services:
  stage_mongodb:
    image: ${MONGODB_IMAGE_TAG}
    container_name: 'stage_mongodb'
    networks:
      stage_backend_network:
    restart: always
    volumes:
      - /var/stage_mongodb/db:/data/db
      - /var/stage_mongodb/configdb:/data/configdb
    logging:
      driver: 'json-file'
      options:
        max-file: '1'
        max-size: '1m'

  stage_backend:
    image: ${APP_IMAGE_TAG}
    container_name: stage_backend-${API_VERSION}
    networks:
      stage_backend_network:
      server_network:
    restart: always
    volumes:
      - /srv/www/stage.angrywords.ru/:/srv/www/:rw
    logging:
      driver: 'json-file'
      options:
        max-file: '1'
        max-size: '1m'
    environment:
      - ENVIRONMENT=${ENVIRONMENT}
      - LOG_LEVEL=${LOG_LEVEL}
      - API_VERSION=${API_VERSION}
      - PORT=${APP_INTERNAL_PORT}
      - MONGODB_HOST=${MONGODB_HOST}
      - MONGODB_PORT=${MONGODB_INTERNAL_PORT}
      - MONGODB_DB_NAME=${MONGODB_DB_NAME}
      - API_ACCESS_TOKEN_SECRET_KEY=${API_ACCESS_TOKEN_SECRET_KEY}
      - NOREPLY_EMAIL_BOX_PASSWORD=${NOREPLY_EMAIL_BOX_PASSWORD}
      - USER_EMAIL_SENDING_ENABLED=${USER_EMAIL_SENDING_ENABLED}
      - YOOKASSA_MERCHANT_ID=${YOOKASSA_MERCHANT_ID}
      - YOOKASSA_SECRET_KEY=${YOOKASSA_SECRET_KEY}
      - APP_STORE_API_KEY_ID=${APP_STORE_API_KEY_ID}
      - APP_STORE_SHARED_SECRET=${APP_STORE_SHARED_SECRET}
      - AMPLITUDE_API_KEY=${AMPLITUDE_API_KEY}

networks:
  stage_backend_network:
    driver: bridge
    name: 'stage_backend_network'
  server_network:
    external: true